class Person {
    private _name: string
    constructor(name : string) {
        this._name = name
    }

    // 私有属性的时候推荐用getter和setter 构造器
    set n(newName) {
        this._name = newName
    }
    get n() {
        return this._name
    }
}

const p = new Person('zhansan')
p.n = 'lisi'
console.log(p.n)
export{}